
"""
unittest:
    定义单元测试   unittest.TestCase

"""

import unittest

class Demo(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.name = "laoliu"
        print("初始化函数")
    #def setUp(self):

    def testjiafa(self):
        print()
        a = 100
        b = 200
        print(self.name)
        self.assertEqual(a+b,300)
    def testjianfa(self):
        a = 200
        b = 100
        self.assertEqual(a-b,100)
    @classmethod
    def tearDown(self):
        print("销毁函数")

if __name__ == '__main__':
    unittest.main